#!/usr/bin/env python
import os

HOME=os.environ['HOME']

# Define Database connection
# db://username:password@server:port/databasename
SQLBind='mysql://zincuser:zincpass@130.60.169.80:8081/zincnew02'

# define table name in the database
MoleculeTableName='zincmol'
PoseTableName='pose'

# define column in tables 
MoleColumn={
    'id':'INT,primary_key=True',
    'numatoms':'INT,deferred=True',
    'numc':'INT,deferred=True',
    'numn':'INT,deferred=True',
    'numo':'INT,deferred=True',
    'numhal':'INT,deferred=True',
    'nums':'INT,deferred=True',
    'nump':'INT,deferred=True',
    'numarombnd':'INT,deferred=True',
    'numdoubbnd':'INT,deferred=True',
    'numtribnd':'INT,deferred=True',
    'numamibnd':'INT,deferred=True',
    'numacc':'INT,deferred=True',
    'numdon':'INT,deferred=True',
    'numring':'INT,deferred=True',
    'totringsize':'INT,deferred=True',
    'longestchain':'INT,deferred=True',
    'wienerind4':'FLOAT,deferred=True',
    'numbnd':'INT,deferred=True',
    'numfrg':'INT,deferred=True',
    'numrotbnd':'INT,deferred=True',
    'mw':'FLOAT,deferred=True',
    'clogp':'FLOAT,deferred=True',
    'charge':'INT,deferred=True',
}

# define Protein Name
ProteinName='ephb4' 

# define the scratch directory, which is writable and readable.
TMPDIR='/scratch/zhou' 

# define template file that contains all the config files of autodock.
# supprot bzip2 and gzip
# support normal files, http and ftp protocls
# http://hostname/xxx.tgz OR ftp://ftphost/xxx.tgz
TemplateFile='http://130.60.169.80:8088/tempdvsdms.tgz'

# define command file. You can stop the running gracefully by write "stop" in that file
# support http ftp and normal file
# This file should be available during the calculation
CmdFile=''

# queuing system wall time in hour
QWallTime=48

# Time needed for one docking in hour. 
# If the left time is shorter than this value, the program will terminated.
SingRunTime=0.5

# setup AutoDock
# path of 'pythonsh' in AutoDockTools. usually at 'MGLTools-1.4.6/share/bin/pythonsh'
# HOME, which is your home folder, can also be used here. eg, HOME+'/MGLTools-1.4.6/share/bin/pythonsh'
pythonsh=HOME+'/MGLTools-1.4.6/share/bin/pythonsh'
# path of 'pythonsh' in AutoDockTools. usually at 'MGLTools-1.4.6/MGLToolsPckgs/AutoDockTools/Utilities24/prepare_ligand4.py'
prepare_ligand4=HOME+'/MGLTools-1.4.6/MGLToolsPckgs/AutoDockTools/Utilities24/prepare_ligand4.py'
# AutoDock binary file. It can be plain, gzipped, or bzipped.
# SrcAutoDock=(HOME+'/autodock/autodock.gz','')
# SrcAutoDock=(HOME+'/autodock/autodock.gz','bz')
SrcAutoDock=(HOME+'/autodock/autodock.gz','gz')
# if Autodock is zipped, related unzip command is required.
gunzip='gunzip'
bunzip='bunzip2'

# define temporary ligand file name. Make it whatever you like.
LIGNAME='ligand1'

################  Never Modified ####################
MoleculeTagTableName=MoleculeTableName+'tag'
PoseTagTableName=PoseTableName+'tag'

# This term related to the autodock output
#USER    Estimated Free Energy of Binding    =   -7.64 kcal/mol  [=(1)+(2)+(3)-(4)]
#USER    Estimated Inhibition Constant, Ki   =    2.53 uM (micromolar)  [Temperature = 298.15 K]
#USER    
#USER    (1) Final Intermolecular Energy     =   -9.32 kcal/mol
#USER        vdW + Hbond + desolv Energy     =   -9.88 kcal/mol
#USER        Electrostatic Energy            =   +0.56 kcal/mol
#USER    (2) Final Total Internal Energy     =   -0.22 kcal/mol
#USER    (3) Torsional Free Energy           =   +1.65 kcal/mol
#USER    (4) Unbound System's Energy         =   -0.25 kcal/mol
PoseColumn={
    'rank':'INT',
    'feb':'Float',
    'ic':'Float',
    'fie':'Float',
    'vhde':'Float',
    'ee':'Float',
    'ftie':'Float',
    'tfe':'Float',
    'use':'Float',
}